<extend name="Common/common" />
<block name="main">
    <div id="page-wrapper" class="gray-bg dashbard-1">
        <include file="Common/nav-header"/> <!--顶部-->
        <div class="col-lg-12">
            <div class="ibox float-e-margins">
                <div class="ibox-title">
                    <h5>员工照片上传</h5>
                </div>
                <div class="ibox-content">
                    <form class="form-horizontal m-t " id="form1" method="post" action="{:U('add')}" enctype="multipart/form-data">
                        <input type="hidden" name='id' value="{$_GET['id']}">
                        <div class="form-group">
                            <label class="col-sm-3 control-label">员工姓名：</label>
                            <div class="col-sm-3">
                                <input  type="text" id="member_name" class="form-control" name="name" value="{$data.name}">
                            </div>
                        </div>
                        <div class="form-group">
                            <label class="col-sm-3 control-label">员工职位：</label>
                            <div class="col-sm-3">
                                <input  type="text" id="member_position" class="form-control" name="position" value="{$data.name}">
                            </div>
                        </div>
                        <div class="form-group">
                            <label class="col-sm-3 control-label">员工介绍：</label>
                            <div class="col-sm-3">
                                <textarea id="member_introduce" class="form-control" name="introduce" value="{$data.name}" placeholder="最多输入50字..."></textarea>
                            </div>
                        </div>
                        <div class="form-group">
                            <label class="col-sm-3 control-label">排序：</label>
                            <div class="col-sm-3">
                                <input  type="text" id="sort" class="form-control" name="sort" value="{$data.sort}">
                            </div>
                        </div>
                        <div class="form-group">
                            <label class="col-sm-3 control-label">图片上传：</label>
                            <div class="col-sm-3">
                                <input  type="file" id="pic" name="pic" value="{$data.pic}">
                            </div>
                        </div>
                        <div class="form-group">
                            <label class="col-sm-3 control-label">是否显示：</label>
                            <input type="radio"  value="0"  name="is_display" <if condition="($data.is_display neq 1)">checked </if> />
                            否
                            <input type="radio"  value="1"  name="is_display" <if condition="($data.is_display eq 1)">checked </if> />
                            是
                        </div>
                        <div class="form-group">
                            <div class="col-sm-4 col-sm-offset-3">
                                <button class="btn btn-primary" type="submit">提交</button>
                            </div>
                        </div>
                    </form>
                </div>
            </div>
        </div>
        <!--尾部-->
        <include file="Common/admin:footer"/>
    </div>
    <script>
        $('#form1').submit(function(){
            var name = $('#member_name').val();
            var pic = $('#pic').val();
            var sort = $("#sort").val();
            if(name == ''){
                layer.msg('请填写员工姓名',{time:1000});
                return false;
            }
            if(!sort || isNaN(sort)){
                layer.msg('请填写排序，并且为数字',{time:1000});
                return false;
            }
            if(pic == ''){
                layer.msg('请上传图片',{time:1000});
                return false;
            }
        });

            // return false;
        </script>
    </block>

